$('form').submit(function(ev) {
    ev.preventDefault()

    var data = $(this).serialize()

    $.post('/api/user/signin', data, function(res) {
        alert(res.message)
        if (res.code == 'success') {
            location.href = '/'
        } else {
            if(res.code == 'register error'){
                location.href = '/user/register.html'
            }
        }
    })
})